package org.wisdom.ac.domain.resource.entity;

import java.util.List;

import javax.persistence.*;

import lombok.*;

/**
 * 系统应用页面
 *
 * @author zhangzhiyan
 * @date 2022/04/29 09:59
 **/
@SuppressWarnings("JpaDataSourceORMInspection")
@EqualsAndHashCode(callSuper = true)
@Entity
@DiscriminatorValue(value = "2")
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
public class AcAppPage extends AcResource {
    /** 所属应用ID */
    private String appId;

    /** 页面路径 */
    private String url;

    /** 页面包含的服务接口 */
    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
    @JoinColumn(name = "appPageId")
    private List<AcAppPageFacade> appPageFacades;

    /** 页面包含的组件 */
    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
    @JoinColumn(name = "appPageId")
    private List<AcAppPageWidget> appPageWidgets;

    /** 页面包含的元素 */
    @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
    @JoinColumn(name = "appPageId")
    private List<AcAppPageElement> appPageElements;
}